"""
产品价格实体类
"""
from sqlalchemy import Column, Integer, String, DateTime, Text, ForeignKey
from sqlalchemy.orm import relationship

from config.database import BaseMixin, Base


class BgProductPrice(Base, BaseMixin):
    """产品价格实体"""
    __tablename__ = 'bg_product_price'

    # 产品ID（外键）
    product_id = Column(Integer, ForeignKey('bg_product.id'), nullable=False, comment='产品ID')
    
    # 实际价格（分为单位）
    random_price = Column(Integer, nullable=False, comment='实际价格（分）')
    
    # 支付二维码图片URL
    image_url = Column(Text, comment='支付二维码图片URL')
    
    # 关联关系
    product = relationship("BgProduct", back_populates="prices")
